<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
        content="width=device-width,initial-scale=1.0,viewport-fit=cover,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
    <title>尤迈桃李会</title>
    <script src="js/rem.js"></script>
    <link rel="stylesheet" href="https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css" />
    <link rel="stylesheet" href="css/weui.min.css">
    <link rel="stylesheet" href="css/jquery-weui.min.css">
    <link rel="stylesheet" href="css/public.css">
    <link rel="stylesheet" href="css/ot-classroom-index.css">
    <script>(function () { var _53code = document.createElement("script"); _53code.src = "https://tb.53kf.com/code/code/96d8f960b261e49515450f8953b044bc5/1"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(_53code, s); })();</script>
</head>

<body>
    <div class="pub_bar" title="尤迈桃李会" left="back"></div>
    <!--  -->
    <div class="pub-container has-tabbar  bgwhite">
        <!-- 公共部分 - header -->
        <header class="pub-header">
            <div class="header-box">
                <input type="text" class="search" placeholder="">
                <a href="./ot-myClass.html">
                    <div class="footprint">足迹</div>
                </a>
                <a href="./ot-signIn.html">
                    <div class="sign-in">签到</div>
                </a>
            </div>
        </header>
        <!-- 公共 - 菜单 -->
        <div class="pub-menu plr15">
            <ul class="menu-list">
                <!-- <li class="menu-item">
                    <a href="#">推荐</a>
                </li>
                <li class="menu-item">
                    <a href="ot-doctor-index.html?search=癫痫病">癫痫病</a>
                </li>
                <li class="menu-item">
                    <a href="ot-doctor-index.html?search=白内障">白内障</a>
                </li>
                <li class="menu-item">
                    <a href="ot-doctor-index.html?search=白内障">白内障</a>
                </li>
                <li class="menu-item">
                    <a href="ot-doctor-index.html?search=癫痫病">癫痫病</a>
                </li>
                <li class="menu-item">
                    <a href="ot-doctor-index.html?search=白内障">白内障</a>
                </li> -->
            </ul>
        </div>
        <!-- 公共 - banner -->
        <div class="pub-banner plr15" id="topBanner">
            <!-- <div id="player" style="height: 300px;"></div> -->
            <!-- <div id="topBanner"></div>
            <a href="javascript:;"><img src="image/placeholder/1.jpg" alt=""></a> -->
        </div>
        <!-- 讲堂 - 列表 -->
        <div class="pub-main classroom-main">
            <!-- 讲堂 - tab -->
            <ul class="classroom-tabs space-border hxl-classroom-tabs" id="tabBox">
                <li class="classroom-tab" data-url="./ot-curriculum-index.html">课程</li>
                <li class="classroom-tab" data-url="./classroom-index.html">直播</li>
                <li class="classroom-tab" data-url="./consultation-index.html">研讨</li>
            </ul>
            <!-- 最新课程 -->
            <div class="new-course pb15 space-border">
                <div class="pub_small_header plr15">
                    <a href="./ot-doctor-index.html">
                        <div class="title">最新课程</div>
                        <div class="right"><img src="./image/hxl/hxl-right.png" alt=""></div>
                    </a>
                </div>
                <!--  -->
                <ul class="list">
                </ul>
            </div>
            <!-- 正在直播 -->
            <div class="onlive pb15 space-border">
                <div class="pub_small_header plr15">
                    <a href="./classroom-index.html">
                        <div class="title">正在直播</div>
                        <div class="right"><img src="./image/hxl/hxl-right.png" alt=""></div>
                    </a>
                </div>
                <!--  -->
                <ul class="list plr15">
                </ul>
            </div>
            <!-- 热门课程 -->
            <div class="hot-course pb15">
                <div class="pub_small_header plr15">
                    <a href="./ot-curriculum-index.html">
                        <div class="title">热门课程</div>
                        <div class="right"><img src="./image/hxl/hxl-right.png" alt=""></div>
                    </a>
                </div>
                <!--  -->
                <ul class="list">
                </ul>
            </div>
            <!-- 会诊宣传片、会诊案例 -->
            <div class="pub-main consultation-main space-border active1" id="mainBox">
                <!-- 导航 -->
                <ul class="navs clearfloat">
                    <li class="nav" id="tab1">会诊宣传片</li>
                    <li class="nav" id="tab2">会诊案例</li>
                    <div class="right"><a href="./consultation-index.html"><img src="./image/hxl/hxl-right.png"
                                alt=""></a></div>
                </ul>
                <ul class="pub-list" id="contentList">
                    <li>
                        <!-- 列表 - 会诊宣传片 -->
                        <div class="list video-list">
                            <!-- <img data-videoId=""
                                src="https://nqct.ip58.lhyw.net:41000/uploadCard/9acf2264ef25468394b1c56d3aa803e2.jpg"
                                alt=""> -->
                        </div>
                    </li>
                    <li>
                        <!-- 列表 - 会诊案例 -->
                        <div class="list case-list">
                        </div>
                    </li>
                </ul>
                <!-- <div class="weui-loadmore" id="loadMore">
                    <i class="weui-loading"></i>
                    <span class="weui-loadmore__tips">正在加载</span>
                </div>
                <div class="weui-loadmore weui-loadmore_line hide" id="noMore">
                    <span class="weui-loadmore__tips">没有更多数据了</span>
                </div> -->
            </div>
        </div>
        <!-- 公共footer -->
        <div class="pub-footer">
            <ul class="tabs">
                <li class="tab-classroom active"><a href="./ot-classroom-index.html">首页</a></li>
                <li class="tab-doctor"><a href="./ot-doctor-index.html">名医</a></li>
                <li class="tab-curriculum"><a href="./ot-curriculum-index.html">课程</a></li>
                <li class="tab-forum"><a href="./classroom-index.html">讲堂</a></li>
                <li class="tab-consultation"><a href="consultation-index.html">会诊</a></li>
                <li class="tab-user"><a href="user.html">我的</a></li>
            </ul>
        </div>
        <!-- 预约弹窗 -->
        <div class="reserve popup">
            <div class="cont login-wrapper plr15">
                <div class="tit" id="reserveTit">预约</div>
                <form action="#" method="post" onsubmit="reverseSubmit();return false;" id="reserveForm"
                    autocomplete="false">
                    <ul class="list">
                        <li><input class="input" name="loginMobile" type="text" placeholder="请输入手机号码"></li>
                        <li class="other-btns flex-btw">
                            <input class="input" name="checkCode" type="text" placeholder="请输入手机验证码">
                            <span class="get-code-btn" id="getCodeBth">获取验证码</span>
                        </li>
                    </ul>
                    <input class="pub-submit-btn" id="reserveBtn" type="submit" value="马上预约">
                </form>
            </div>
        </div>
    </div>
    <script src="https://g.alicdn.com/de/prismplayer/2.9.3/aliplayer-h5-min.js"></script>
    <script src="js/jquery-3.6.0.min.js"></script>
    <script src="js/jquery-weui.min.js"></script>
    <script src="js/md5.js"></script>
    <script src="js/public.js"></script>
    <script>
        let page = 0

        $(document).on('click', '.classroom-tab', function () {
            location.href = $(this).attr('data-url')
        })

        $(document).on('keyup', '.search', function (event) {
            if (event.keyCode == 13) {
                location.href = './ot-doctor-index.html?search=' + $(this).val()
            }
        })

        // tab切换
        $('#tab1').click(function () {
            type = 'case';
            $('#mainBox').removeClass('active2').addClass('active1');
        })
        $('#tab2').click(function () {
            type = 'new';
            $('#mainBox').removeClass('active1').addClass('active2');
        })

        getData()
        function getData(type) {
            gethttp('/ld/home?type=c', {
                success: function (res) {
                    let hotDoctors = res.data.hotDoctors.list
                    let hotDoctors_arr = []
                    hotDoctors.forEach((item, index) => {
                        let hotDoctors_html = `<li class="list_item">
                                            <a href="./ot-doctor-detail.html?doctor=${item.id}">
                                                <div class="list_item_img"><img src="${item.imageUrlUi}" alt=""></div>
                                                <p class="list_item_p1 text-cut-one">${item.name ? item.name : '名称'}</p>
                                            </a>
                                        </li>`
                        hotDoctors_arr.push(hotDoctors_html)
                        $('.new-course .list').html(hotDoctors_arr)
                    });

                    let hotDiseases = res.data.hotDiseases
                    hotDiseases.forEach((item, index) => {
                        if (item.name == '空') {
                            return false
                        }
                        $('.menu-list').append(`<li class="menu-item">
                                                <a href="ot-doctor-index.html?search=${item.name}">${item.name}</a>
                                            </li>`)
                    })




                    let list = res.data.hotCourses.list
                    let arr = []
                    list.forEach(function (item, index) {
                        let html = `<li class="list_item space-border">
                                        <div class="hot_top">
                                            <p>${item.learnCountUi}人正在学习｜${item.playCountUi}播放</p>
                                            <p>${item.createdAtUi}上线</p>
                                        </div>
                                        <div class="hot_center">
                                            <div class="hot_left">
                                                <div class="hot_p1">共${item.serieCount}讲</div>
                                                <img class="hot_img" src="${item.coverUrlUi}" alt="">
                                                <div class="hot_p2">${item.doctorName} 专家</div>
                                            </div>
                                            <div class="hot_right">
                                                <div class="hot_p3 text-cut-one">${item.name}</div>
                                                <div class="hot_p4">${item.doctorName}&emsp;${item.doctorCompetentName}</div>
                                                <div class="hot_p4">${item.doctorHospitalName}&emsp;${item.doctorDepartName}</div>
                                                <div class="hot_p5">${item.labels}</div>
                                                <a href="./ot-classroom-play.html?doctor=${item.doctor}&courseId=${item.id}">
                                                    <div class="hot_btn">开始听课</div>
                                                </a>
                                            </div>
                                        </div>
                                    </li>`
                        arr.push(html)
                    })
                    $('.hot-course .list').html(arr)
                }
            })
        }


        var pageStatus = {
            case: { currentPage: 1, loadEnd: false, getList: getCaseList },
            // new: { currentPage: 1, loadEnd: false, getList: getNewList }
        };
        var type = 'case', loading = false;
        // 获取案例列表
        function getCaseList() {
            var caseOption = pageStatus.case;
            http('/ad/getAllExample', {
                hasToken: false,
                noEncry: true,
                data: {
                    currentPage: caseOption.currentPage,
                    pageSize: PAGESIZE
                },
                success: function (res) {
                    if (res.code === '01') {
                        var data = res.data, html = '';
                        data.forEach(function (item) {
                            html += '<a href="consultation-detail.html?type=case&id=' + item.exampleId + '">' +
                                '<dl class="item">' +
                                '<dt><img class="case-img" src="' + item.file.uploadUrl + '" alt="' + item.file.uploadName + '"></dt>' +
                                '<dd>' + item.title + '</dd>' +
                                '</dl>' +
                                '</a>';
                        })


                        // 判断是否是最后一页
                        caseOption.loadEnd = (data.length < PAGESIZE);

                        // 判断是否是第一页
                        caseOption.currentPage === 1 ? $('.case-list').html(html) : $('.case-list').append(html);

                        caseOption.currentPage++;
                    }
                },
                complete: function () {
                    loading = false;
                }
            })
        }

        getCaseList();

        // 获取广告列表
        function getBanner() {
            // 获取顶部
            http('/ad/getAllAd', {
                hasToken: false,
                data: {
                    id: '5' // 广告图位置 1 顶部 2 中部
                },
                success: function (res) {
                    if (res.code === '01') {
                        res.data.length > 0 ? $('#topBanner').html(getAdHtml(res.data[0])).show() : $('#topBanner').hide();
                    }
                }
            })
        }

        http('/ad/getAllAd', {
            hasToken: false,
            data: {
                id: '4' // 广告图位置 1 顶部 2 中部
            },
            success: function (res) {
                if (res.code === '01') {
                    res.data.length > 0 ? $('.video-list').html(getAdHtml(res.data[0])).show() : $('.video-list').hide();
                }
            }
        })

        http('/reserve/getReserveList', {
            hasToken: false,
            data: {
                userId: getCookie('userId')
            },
            success: function (res) {
                let list = res.data
                for (let i = 0; i < list.length; i++) {
                    $('.onlive .list').append(`<li class="list_item">
                                                <a href="${list[i].url}">
                                                    <div class="list_item_img"><img src="${list[i].imgUrl}" alt=""></div>
                                                    <p class="list_item_p1">${list[i].title}</p>
                                                </a>
                                            </li>`)
                }
            }
        })

        getBanner()
    </script>
</body>

</html>